<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>客流数据统计</title>

<script type="text/javascript" src="../lib/standalone-framework.js"></script>
<script src="../lib/highcharts.js"></script>
<script type="text/javascript">
	function getUrlParam(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		var r = window.location.search.substr(1).match(reg);
		if (r != null)
			return unescape(r[2]);
		return null;
	}
	function get() {
		var projectid = getUrlParam("projectid");
		var passengerflowdate = getUrlParam("passengerflowdate");
		var request = new XMLHttpRequest();
		request.open("GET", "getpassengersales.thor?projectid=" + projectid + "&passengerflowdate=" + passengerflowdate);
		request.onreadystatechange = function() {
				
			if (request.readyState === 4 && request.status === 200) {
				document.getElementById("load").style.display="none";
				var response = JSON.parse(request.responseText);
				drawChart(response);
			}
		}
		request.send();
	}
	function drawChart(chartData) {
		var xdata = chartData.xdata;
		var series = chartData.series;
		var chart = new Highcharts.Chart({
			chart : {
				renderTo : 'container',
				type : 'line'
			},
			title : {
				text : '客流销售额统计'
				// x : -20
			//center
			},
			
			xAxis : {
				categories : xdata
			},
			yAxis : {
				title : {
					text : '客流/销售'
				},
				plotLines : [ {
					value : 0,
					width : 1,
					color : '#808080'
				} ]
			},
			
			series : series
		});
	}
	window.onload = get;
</script>
</head>
<body>
	<div id="container" style="margin: 0 auto"></div>
	<div id="load"  align="center">
		<div id="center" style="position:absolute; left:0; top:120px; width:100%; height:100%; background-color:#FFFFFF; z-index:1000;">
			<table border="0">
				<tr>
					<td><span id="disp" >报表加载中,请等待...</span></td>
				</tr>
			</table>
		</div>
	</div>
</body>
</body>
</html>
